import {request} from './request';
import api from '@/conf/api.js'


export function getLogin(data) {
  return request({
    url: api.login,
	method:"POST",
	data
  })
}

export function getMessage(phone) {
  return request({
    url: api.message,
	method:"GET",
	data:{
		phone
	}
  })
}

export function getAccount(data) {
  return request({
    url: api.account,
	method:"POST",
	data
  })
}

export function getUserNews() {
  return request({
    url: api.user_news,
	method:"GET",
	header:{
		AUTHORIZATION:api.token
	}
  })
}

export function getResetPwd(data) {
  return request({
    url: api.reset_pwd,
	method:"POST",
	data,
	header:{
		AUTHORIZATION:api.token
	}
  })
}
export function getEmailAdd(data) {
  return request({
    url: api.email_add,
	method:"POST",
	data,
	header:{
		AUTHORIZATION:api.token
	}
  })
}

export function getUserData() {
  return request({
    url: api.user_data,
	method:"GET",
	header:{
		AUTHORIZATION:api.token
	}
  })
}

export function getUserDataAdd(data) {
  return request({
    url: api.user_data_add,
	method:"POST",
	data,
	header:{
		AUTHORIZATION:api.token
	}
  })
}
export function getUserSpace(uid) {
  return request({
    url: api.user_space+uid+"/",
	method:"GET",
	header:{
		AUTHORIZATION:api.token
	}
  })
}

export function getUserPosts(uid,status="",mid) {
  return request({
    url: api.user_posts+`${uid}/?status=${status}&max_id=${mid}`,
	method:"GET",
	header:{
		AUTHORIZATION:api.token
	}
  })
}
export function getUserSetPwd(data) {
  return request({
    url: api.user_setpwd,
	method:"POST",
	data,
	header:{
		AUTHORIZATION:api.token
	}
  })
}
export function getUserOrther(data) {
  return request({
    url: api.user_orther,
	method:"POST",
	data,
	header:{
		AUTHORIZATION:api.token
	}
  })
}
export function getUserOrtherList(data) {
  return request({
    url: api.user_orther_list,
	method:"POST",
	data,
  })
}